package myJs.myPkg.reactBootstrap

import japgolly.scalajs.react.facade.React
import japgolly.scalajs.react.vdom.VdomNode
import japgolly.scalajs.react.vdom.all._
import japgolly.scalajs.react.{CtorType, ScalaFnComponent}
import myJs.cps.MyScalaFnComponent
import slinky.readwrite._

import scala.scalajs.js
import scala.scalajs.js.ConstructorTag

/** Created by yz on 20/10/2023
  */
@js.native
trait MyReactComponentClass[P] extends js.Object

object MyReactComponentClass {

  implicit def scalaFnComponentToClass[P](
      component: MyScalaFnComponent[P]
  )(implicit propsReader: Reader[P]): MyReactComponentClass[P] = {
    component.componentWithReader(propsReader).asInstanceOf[MyReactComponentClass[P]]
  }

}
